package com.cq.hd.member.controller;

import com.cq.hd.common.pagination.Page;
import com.cq.hd.common.response.Result;
import com.cq.hd.common.response.ResultGenerator;
import com.cq.hd.member.api.TbBusinessRechargeApplyApi;
import com.cq.hd.member.api.dto.*;
import com.cq.hd.member.api.vo.*;
import com.cq.hd.member.service.TbBusinessRechargeApplyService;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 商家充值申请 前端控制器
 * </p>
 */
@RestController
public class TbBusinessRechargeApplyController implements TbBusinessRechargeApplyApi {

    @Autowired
    private TbBusinessRechargeApplyService businessRechargeApplyService;

    @ApiOperation(value = "商家充值申请列表")
    @ApiResponse(response = BusinessRechargeApplyPageVo.class, code = 200, message = "接口返回对象参数")
    @Override
    public Result<Page<BusinessRechargeApplyPageVo>> page(BusinessRechargeApplyPageDto businessRechargeApplyPageDto) {
        return ResultGenerator.success(businessRechargeApplyService.page(businessRechargeApplyPageDto));
    }

    @ApiOperation(value = "商家充值申请")
    @ApiImplicitParam(name = "businessRechargeApplyDto", value = "实体", required = true, paramType = "body", dataType = "BusinessRechargeApplyDto")
    @Override
    public Result<Integer> apply(@RequestBody BusinessRechargeApplyDto businessRechargeApplyDto) {
        return ResultGenerator.success(businessRechargeApplyService.apply(businessRechargeApplyDto));
    }

    @ApiOperation(value = "审核充值申请")
    @ApiImplicitParam(name = "businessRechargeApplyAuditDto", value = "实体", required = true, paramType = "body", dataType = "BusinessRechargeApplyAuditDto")
    @Override
    public Result<Boolean> audit(@RequestBody BusinessRechargeApplyAuditDto businessRechargeApplyAuditDto) {
        return ResultGenerator.success(businessRechargeApplyService.audit(businessRechargeApplyAuditDto));
    }
}
